<template>
      <div>
          <ltnavbar :title="data.name"></ltnavbar>
          <mu-container style="width: 100%;">

              <mu-carousel hide-controls v-if="data.image">
                  <mu-carousel-item v-for="item in data.image">
                      <img :src="item">
                  </mu-carousel-item>
              </mu-carousel>

              <mu-card style="width: 100%; " >
                  <mu-card-header :title="data.server_name" :sub-title="'预算￥：'+data.fee">
                      <mu-avatar slot="avatar">
                          <img :src="data.server_avatar" :onerror="img_error">
                      </mu-avatar>
                  </mu-card-header>

              </mu-card>
              <mu-tabs :value.sync="active1" inverse color="secondary" text-color="rgba(0, 0, 0, .54)"  center>
                  <mu-tab>详情</mu-tab>
                  <mu-tab>合作</mu-tab>
              </mu-tabs>
              <div class="demo-text" v-if="active1 === 0">

                  <mu-card style="width: 100%; padding: 2rem 1rem;" >
                  <mu-card-text v-html="data.name">  </mu-card-text>
                  <mu-card-text v-html="data.desc">  </mu-card-text>
                  <mu-card-text v-html="data.content">  </mu-card-text>
                  </mu-card>
              </div>
              <div class="demo-text" v-if="active1 === 1">
                  <mu-card style="width: 100%; padding: 2rem 1rem;text-align: center" >
                      <p>
                          <mu-button color="yellow">
                              考虑合作
                          </mu-button>
                          <mu-button color="blue">
                              三方合作
                          </mu-button>
                          <mu-button color="red">
                              直接合作
                          </mu-button>
                      </p>
                  </mu-card>
              </div>
          </mu-container>
      </div>
</template>
<script>

    import ltnavbar from "@/view/common/navbar";

    export default {
        data () {
            return {
                data:{

                },
                active1: 0,
                site_url:BASE.site_url,
                img_error:"this.src='"+require("@/img/logo.png")+"'",
            }
        },
        mounted(){
            this.load();
        },
        methods: {
            load(){
                let $this = this;
                let id = this.$route.query.id;
                $this.$api.server_good_one({id:id},function(resp){
                    if(resp.code == 0){
                        $this.data = resp.data;
                    }else{
                        this.$toast.error(resp,msg);
                    }
                });
            }
        },
        components:{
            ltnavbar
        }
    };
</script>